/**
 *  主要用于统一主管 周、月、季 评时
 *  带教人与主管为同一人的情况
 *  数据还是有外部传入
 */
import React from 'react';
import { Typography, Divider } from 'antd';
import AssessAbilityDetail from './AssessAbilityDetail';
import AssessTotal from './AssessTotal';

export default function AssessLeaderDetail({ data = {}, detail = {} }) {
    const { teacherEqLeader } = data;
    const onlyLeader = teacherEqLeader === 1;

    return (
        <>
            <AssessTotal data={detail.total} levels={data?.assessAbility?.levels} />

            <Divider />

            {!onlyLeader && (
                <>
                    <Typography.Paragraph>
                        <strong>带教人评估</strong>
                    </Typography.Paragraph>
                    <AssessAbilityDetail data={detail.teacher} record={data} />

                    <Divider />
                </>
            )}

            <Typography.Paragraph>
                <strong>主管评估</strong>
            </Typography.Paragraph>
            <AssessAbilityDetail data={detail.leader} record={data} />
        </>
    );
}
